﻿
<div class="modal-header">
    <button type="button" class="close" ng-disabled="loadingState" ng-click="close();"><span aria-hidden="true">&times;</span></button>
    <h3>
        <i class="fa fa-history"></i>
        考生延时
        <small>考生：{{examineeName}}</small>
    </h3>
</div>
<div class="modal-body">
    <form id="examineeDelayForm" role="form" class="form-horizontal">
        <div class="form-group">
            <label class="col-sm-4 control-label" for="minutes">延时时长(分钟)：</label>

            <div class="col-sm-6">
                <input type="number" class="form-control input-inline" id="minutes" name="minutes" ng-model="minutes" placeholder="请输入延时时长" ng-disabled="loadingState" />
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-4 control-label" for="reason">理由：</label>

            <div class="col-sm-6">
                <textarea rows="3" class="form-control input-inline" id="reason" name="reason" ng-model="reason" placeholder="请输入理由" ng-disabled="loadingState"></textarea>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-turquoise" ng-click="save();" ng-disabled="loadingState">
        <i class="fa fa-history" ng-hide="loadingState"></i>
        <i class="fa fa-spinner fa-spin" ng-show="loadingState"></i>
        <span>确定延时</span>
    </button>
    <button type="button" class="btn btn-gray" ng-click="close();" ng-disabled="loadingState">
        <i class="fa fa-close"></i>
        <span>关闭</span>
    </button>
</div>

<script>
    $(function () {
        $('form#examineeDelayForm').validate({
            rules: {
                minutes: {
                    required: true,
                    digits: true,
                    number: true,
                    min: 1
                }
            },
            messages: {
                minutes: {
                    required: '请输入延时时长！',
                    digits: '请输入整数分钟！',
                    number: '请输入整数分钟！',
                    min: '请输入大于1分钟的延时时长！'
                }
            }
        });
    });
</script>
